package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  Player.java
 * Author:  Rojko
 * Purpose: Defines the Class Player
 ***********************************************************************/

import java.util.*;

/** @pdOid 45fdea3a-ca18-4fac-95f5-b0b4d5d440b9 */
public class Player extends Person {
   /** @pdOid 2b4295c0-ed01-4270-aebd-0ed735d4f070 */
   public int iDPlayer;
   /** @pdOid 6eeaac56-3796-4ece-90cd-4e62b5d53e6a */
   public int playerNumber;
   /** @pdOid 41d47a17-a993-4256-af57-d7038e9779e3 */
   public java.lang.String season;
   
   /** @pdRoleInfo migr=no name=GamePlayers assc=relationship10 coll=java.util.Collection impl=java.util.HashSet mult=0..* type=Composition */
   public java.util.Collection<GamePlayers> gamePlayers;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<GamePlayers> getGamePlayers() {
      if (gamePlayers == null)
         gamePlayers = new java.util.HashSet<GamePlayers>();
      return gamePlayers;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorGamePlayers() {
      if (gamePlayers == null)
         gamePlayers = new java.util.HashSet<GamePlayers>();
      return gamePlayers.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newGamePlayers */
   public void setGamePlayers(java.util.Collection<GamePlayers> newGamePlayers) {
      removeAllGamePlayers();
      for (java.util.Iterator iter = newGamePlayers.iterator(); iter.hasNext();)
         addGamePlayers((GamePlayers)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newGamePlayers */
   public void addGamePlayers(GamePlayers newGamePlayers) {
      if (newGamePlayers == null)
         return;
      if (this.gamePlayers == null)
         this.gamePlayers = new java.util.HashSet<GamePlayers>();
      if (!this.gamePlayers.contains(newGamePlayers))
         this.gamePlayers.add(newGamePlayers);
   }
   
   /** @pdGenerated default remove
     * @param oldGamePlayers */
   public void removeGamePlayers(GamePlayers oldGamePlayers) {
      if (oldGamePlayers == null)
         return;
      if (this.gamePlayers != null)
         if (this.gamePlayers.contains(oldGamePlayers))
            this.gamePlayers.remove(oldGamePlayers);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllGamePlayers() {
      if (gamePlayers != null)
         gamePlayers.clear();
   }

}